<template>
    <div>
        <van-card v-for="i in lblist"  :price="i.goods_price"  :title="i.goods_name"
            :thumb="i.goods_small_logo" @click="tz(i.goods_id)"/>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';
import { useRouter } from 'vue-router';
const router=useRouter()
const route = useRoute()
const lblist = ref([])
axios.get('https://api-hmugo-web.itheima.net/api/public/v1/goods/search', {
    params: {
        cid: route.query.cod
    }
}).then((res) => {
    lblist.value = res.data.message.goods
})
const tz=(goods_id)=>{
    router.push({
        path:'xqq',
        query:{
            goods_id
        }
    })
}
</script>

<style></style>